#include <stdio.h>
#include<iostream>
#include<unistd.h>
#include <sys/types.h>
#include <unistd.h>
#include<signal.h>

void Uasge(const char* str)
{
    std::cout<<"\nuasge:"<<str<< " pid signal\n"<<std::endl;
}
int main(int argc, char* argv[]){
    if(argc != 3)
    {
        std::cout<<"Usage error"<< std::endl;
        Uasge(argv[0]);
        exit(1);
    }
    pid_t id = atoi(argv[1]);
    int sig = atoi(argv[2]);
    int ret = kill(id,sig);
    //成功返回0 ，不成功返回-1
    if(ret == -1)
    {
        perror("kill");
        exit(1);
    }
    return 0;
}
